home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PROGRAMR
/
OLE2BOOK.ZIP
/
CHAP02.ZIP
/
CHAP02
/
PATRON
/
PAGES.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-22
|
4KB
|
139 lines
/*
* PAGES.H
* Original Starter Chapter 2
*
* Definitions and function prototypes for the Pages window control.
*
* Copyright (c)1993 Microsoft Corporation, All Rights Reserved
*
* Kraig Brockschmidt, Software Design Engineer
* Microsoft Systems Developer Relations
*
* Internet : kraigb@microsoft.com
* Compuserve: >INTERNET:kraigb@microsoft.com
*/
#ifndef _PAGES_H_
#define _PAGES_H_
//Versioning.
#define VERSIONMAJOR 2
#define VERSIONMINOR 0
#define VERSIONCURRENT 0x00020000
//Classname
#define SZCLASSPAGES "pages"
#define HIMETRIC_PER_INCH 2540
#define LOMETRIC_PER_INCH 254
#define LOMETRIC_BORDER 60 //Border around page
//Window extra bytes and offsets
#define CBPAGESWNDEXTRA (sizeof(LONG))
#define PAGEWL_STRUCTURE 0
/*
* Page class describing an individual page and what things it contains.
*
* A DWORD is used to identify this page as the name of the storage
* is the string form of this ID. If we added a page every second,
* it would take 136 years to overrun this counter, so we can
* get away with saving it persistently. I hope this software is
* obsolete by then.
*/
class __far CPage
{
private:
DWORD m_dwID; //Persistent DWORD identifier
public:
CPage(DWORD);
~CPage(void);
DWORD GetID(void);
};
typedef CPage FAR * LPPAGE;
//PAGEWIN.CPP
LRESULT __export FAR PASCAL PagesWndProc(HWND, UINT, WPARAM, LPARAM);
BOOL __export FAR PASCAL AbortProc(HDC, int);
BOOL __export FAR PASCAL PrintDlgProc(HWND, UINT, WPARAM, LPARAM);
class __far CPages : public CWindow
{
friend LRESULT __export FAR PASCAL PagesWndProc(HWND, UINT, WPARAM, LPARAM);
friend BOOL __export FAR PASCAL PrintDlgProc(HWND, UINT, WPARAM, LPARAM);
private:
UINT m_iPageCur; //Current page we're viewing
UINT m_cPages; //Number of pages
HWND m_hWndPageList; //Listbox that manages out page list
HFONT m_hFont; //Page font.
BOOL m_fSystemFont; //Is m_hFont system object?
UINT m_cx; //Current page size in LOMETRIC
UINT m_cy;
UINT m_xMarginLeft; //Unusable page margins, LOMETRIC
UINT m_xMarginRight;
UINT m_yMarginTop;
UINT m_yMarginBottom;
UINT m_xPos; //Current viewport scroll position.
UINT m_yPos; //both in *PIXELS*
DWORD m_dwIDNext; //Next ID for a page.
HGLOBAL m_hDevMode; //Current DevMode configuration
char m_szDriver[CCHDEVICENAME];
char m_szDevice[CCHDEVICENAME];
char m_szPort[CCHDEVICENAME];
private:
void Draw(HDC, BOOL, BOOL);
void UpdateScrollRanges(void);
void RectConvertMappings(LPRECT, HDC, BOOL);
BOOL ConfigureForDevice(void);
BOOL FPageGet(UINT, LPPAGE FAR *, BOOL);
BOOL FPageAdd(UINT, DWORD, BOOL);
public:
CPages(HINSTANCE);
~CPages(void);
BOOL FInit(HWND, LPRECT, DWORD, UINT, LPVOID);
void New(void);
BOOL Print(HDC, LPSTR, DWORD, UINT, UINT, UINT);
void RectGet(LPRECT);
void RectSet(LPRECT, BOOL);
void SizeGet(LPRECT);
void SizeSet(LPRECT, BOOL);
UINT PageInsert(UINT);
UINT PageDelete(UINT);
UINT CurPageGet(void);
UINT CurPageSet(UINT);
UINT NumPagesGet(void);
BOOL DevModeSet(HGLOBAL, HGLOBAL);
HGLOBAL DevModeGet(void);
};
typedef CPages FAR * LPCPages;
#endif //_PAGES_H_